﻿#include<iostream>
using namespace std;

int maxof(const int a[], int n) {
	int max = a[0];
	for (int i = 1; i < n; i++) {
		if (a[i] > max) max = a[i];
	}

	return max;
}

int main() {
	const int number = 5;
	int height[number], weight[number];

	cout << "请输入" << number << "个人的身高和体重\n";

	for (int i = 0; i < 5; i++) {
		cout << "第" << i+1 << "个人的身高："; cin >> height[i];
		cout << "第" << i+1 << "个人的体重："; cin >> weight[i];
	}

	int hmax = maxof(height, 5);
	int wmax = maxof(weight, 5);

	cout << "最大身高为：" << hmax << 'cm\n';
	cout << "最大体重为：" << wmax << 'kg\n';

	cin.get();
	cin.get();
}